package com.vitabuybuy.tv.ui.mine.talent.usercenter.viewmodel

import androidx.lifecycle.MutableLiveData
import com.library.common.base.BaseViewModel
import com.library.common.ext.rxHttpRequest
import com.library.common.net.error.msg
import com.library.common.toast.XToast
import com.vitabuybuy.tv.dto.RecordDetailDto
import com.vitabuybuy.tv.dto.TalentWalletDto
import com.vitabuybuy.tv.network.TalentWalletRepository

class IncomeRecordViewModel : BaseViewModel() {
    val detailDto = MutableLiveData<RecordDetailDto>()
    fun getRecordDetail(id: Int?) {
        rxHttpRequest {
            onRequest = {
                detailDto.value = TalentWalletRepository.getRecordDetail(id).await()
            }
            onError = {
                XToast.normal(it.msg)
            }
            isShowDialogRequest = true
        }
    }
}
